@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

:root {
    --primary: #1a365d;
    --secondary: #2d7e3e;
    --accent: #48bb78;
    --gradient: linear-gradient(135deg, #1a365d 0%, #2d7e3e 100%);
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-light: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 20px 60px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Fondo animado con partículas */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="0.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
    opacity: 0.5;
    z-index: 1;
}

/* Partículas flotantes */
body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    animation: float 20s ease-in-out infinite;
    z-index: 1;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Contenedor principal con glassmorphism */
.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 450px;
    margin: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 0;
    box-shadow: var(--shadow-heavy);
    overflow: hidden;
    animation: slideInUp 0.8s ease-out;
    transition: all 0.3s ease;
}

.login-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4);
}

@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Efecto shimmer en el borde superior */
.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Header Section */
.header-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    padding: 40px 40px 30px;
    text-align: center;
    position: relative;
}

.company-logo {
    width: 90px;
    height: 90px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Borde giratorio animado */
.company-logo::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    background: linear-gradient(45deg, #48bb78, #1a365d, #2d7e3e, #48bb78);
    z-index: -1;
    animation: rotateBorder 4s linear infinite;
}

@keyframes rotateBorder {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.company-logo img {
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.company-logo:hover img {
    transform: scale(1.1);
}

.company-name {
    color: white;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
}

.company-tagline {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Formulario */
#login-form {
    padding: 40px 40px 30px;
}

.form-group {
    margin-bottom: 28px;
    position: relative;
}

.form-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.form-input {
    width: 100%;
    padding: 18px 20px 18px 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* Iconos en los inputs */
.form-group {
    position: relative;
}

.form-group::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 50px;
    transform: translateY(-50%);
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    z-index: 2;
    transition: all 0.3s ease;
}

.form-group:first-of-type::before {
    content: '\f0e0'; /* fa-envelope */
}

.form-group:last-of-type::before {
    content: '\f023'; /* fa-lock */
}

.form-group:focus-within::before {
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.form-group:focus-within .form-label {
    color: white;
    transform: translateY(-2px);
}

/* Botón de login */
.login-button {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
}

.login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    transition: left 0.3s ease;
    z-index: -1;
}



.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    background: linear-gradient(135deg, rgba(231, 231, 231, 0.2), rgba(226, 244, 255, 0.1));

}

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.login-button:disabled:hover {
    transform: none;
    box-shadow: none;
}



/* Alertas modernas */
.alert {
    margin-bottom: 20px;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    display: none;
    backdrop-filter: blur(10px);
    border: 1px solid;
    animation: slideInAlert 0.3s ease-out;
}

@keyframes slideInAlert {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: rgba(72, 187, 120, 0.2);
    color: #68d391;
    border-color: rgba(72, 187, 120, 0.3);
}

.alert-error {
    background: rgba(248, 113, 113, 0.2);
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.3);
}

/* Loading indicator */
.loading-indicator {
    display: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    margin-bottom: 20px;
}

.loading-indicator::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer Section */
.footer-section {
    padding: 20px 40px 40px;
    text-align: center;
}

.support-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.support-link::before {
    content: '\f059'; /* fa-question-circle */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.support-link:hover {
    color: white;
    text-decoration: underline;
    transform: translateY(-1px);
}

.security-notice {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    line-height: 1.6;
    max-width: 350px;
    margin: 0 auto;
}

/* Elementos decorativos flotantes */
.login-container::after {
    content: '';
    position: absolute;
    top: 15%;
    right: -20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    animation: floatSlow 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes floatSlow {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(180deg); }
}

/* Responsive */
@media (max-width: 480px) {
    .login-container {
        margin: 10px;
        max-width: none;
    }
    
    .header-section,
    #login-form,
    .footer-section {
        padding-left: 24px;
        padding-right: 24px;
    }

    .company-name {
        font-size: 24px;
    }

    .company-logo {
        width: 80px;
        height: 80px;
    }

    .company-logo img {
        width: 50px;
        height: 50px;
    }

    .form-input {
        font-size: 16px; /* Prevenir zoom en iOS */
        padding: 16px 16px 16px 45px;
    }

    .form-group::before {
        left: 15px;
        top: 47px;
        font-size: 16px;
    }
}

/* Animaciones adicionales para mejor UX */
.form-input:valid {
    border-color: rgba(72, 187, 120, 0.5);
}

.form-input:invalid:not(:placeholder-shown) {
    border-color: rgba(248, 113, 113, 0.5);
}

/* Transiciones suaves para todos los elementos interactivos */
* {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

/* Efectos especiales para navegadores modernos */
@supports (backdrop-filter: blur(20px)) {
    .login-container {
        background: rgba(255, 255, 255, 0.08);
    }
    
    .form-input {
        background: rgba(255, 255, 255, 0.08);
    }
    
    .login-button {
        background: rgba(255, 255, 255, 0.15);
    }
}